import {useEffect, useState} from 'react';
import {Map} from "./components/Map/Map";
import allMap from "./resources/maps";
import {appStore} from "./stores/modules/app";
import {Mob} from "./components/Mob/Mob";
import allSprite from "./resources/sprites";
import './App.scss'
import {LeftFloat} from "./components/LeftFloat/LeftFloat";
import {LeftFloatSprite} from "./components/LeftFloatSprite/LeftFloatSprite";

export default function App() {

  const [isLoad, setIsLoad] = useState<boolean>(false)

  useEffect(() => {
    appStore.allMap = allMap
    appStore.allSprite = allSprite
    setIsLoad(false)
  }, []);

  return (
    <div>
      {isLoad ? '加载中' :
        <>
          <Mob>
            <Map/>
          </Mob>
          <LeftFloat/>
          <LeftFloatSprite/>
        </>
      }
    </div>
  );
}
